package data;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author Michal Hanzlik, Tomas Jiran
 */
/*
 create table Reziser (
 id_osoby             INT4                 not null,
 popis                VARCHAR(1024)        null,
 constraint PK_REZISER primary key (id_osoby)
 );
 */
@Entity
@Table(name = "reziser")
@DiscriminatorValue("REZISER")
public class Reziser extends Osoba {
    /**
     * popis VARCHAR(1024) null,
     */
    @Column(columnDefinition = "varchar(1024)")
    private String popis;
    
    @ManyToMany(mappedBy = "reziseri")
    private List<Film> filmy;

    public Reziser() {
        filmy = new ArrayList<>();
    }

    public Reziser(int ID_o, String jmeno, String prijmeni) {
        super(ID_o, jmeno, prijmeni);
    }
    
    @Override
    public String toString() {
        return getJmeno()+" "+getPrijmeni();
    }
    
    public String getPopis() {
        return popis;
    }

    public void setPopis(String popis) {
        this.popis = popis;
    }

    public List<Film> getFilmy() {
        return filmy;
    }

    public void setFilmy(List<Film> filmy) {
        this.filmy = filmy;
    }
}